+2007-05-18 Carlos Garnacho <carlos@imendio.com>
+
+ * gtk/gtknotebook.c (gtk_notebook_init) (gtk_notebook_drag_motion)
+ (gtk_notebook_drag_drop): Allow widgets up in the hierarchy to run
+ their DnD handlers if the target doesn't match with anything the
+ notebook manages. (#350665, Joakim Lundborg).
+
2007-05-18 Carlos Garnacho <carlos@imendio.com>
Refactor GtkFileChooserDialog sizing.
priv->during_detach = FALSE;
priv->has_scrolled = FALSE;
- gtk_drag_dest_set (GTK_WIDGET (notebook),
- GTK_DEST_DEFAULT_MOTION | GTK_DEST_DEFAULT_DROP,
+ gtk_drag_dest_set (GTK_WIDGET (notebook), 0,
notebook_targets, G_N_ELEMENTS (notebook_targets),
GDK_ACTION_MOVE);
gdk_drag_status (context, GDK_ACTION_MOVE, time);
return TRUE;
}
+ else
+ {
+ /* it's a tab, but doesn't share
+ * ID with this notebook */
+ gdk_drag_status (context, 0, time);
+ }
}
priv = GTK_NOTEBOOK_GET_PRIVATE (widget);
x += widget->allocation.x;
y += widget->allocation.y;
- if (target == tab_target)
- {
- /* it's a tab, but doesn't share
- * ID with this notebook */
- gdk_drag_status (context, 0, time);
- }
-
if (gtk_notebook_get_event_window_position (notebook, &position) &&
x >= position.x && x <= position.x + position.width &&
y >= position.y && y <= position.y + position.height)
}
}
- return TRUE;
+ return (target == tab_target) ? TRUE : FALSE;
}
static void
gint y,
guint time)
{
- GdkAtom target;
+ GdkAtom target, tab_target;
target = gtk_drag_dest_find_target (widget, context, NULL);
+ tab_target = gdk_atom_intern_static_string ("GTK_NOTEBOOK_TAB");
- if (target == GDK_NONE)
- gtk_drag_finish (context, FALSE, FALSE, time);
+ if (target == tab_target)
+ {
+ gtk_drag_get_data (widget, context, target, time);
+ return TRUE;
+ }
- return TRUE;
+ return FALSE;
}
static void